package com.gxuwz.leave.servlet;

import jakarta.servlet.RequestDispatcher;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

public class BaseHttpServlet extends HttpServlet {

    protected final String ErrorPage_500 = "/error/500.jsp";

    protected void doDispatch(HttpServletRequest req, HttpServletResponse resp, String path)throws ServletException, IOException {
        RequestDispatcher dispatcher =req.getRequestDispatcher(path);
        dispatcher.forward(req,resp);
    }

    protected void doRedirect(HttpServletRequest req, HttpServletResponse resp,String location)throws ServletException,IOException{
        resp.sendRedirect(location);
    }

}
